package com.kaibes.admin.email;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.kaibes.web.admin.AdminMenu;
import com.kaibes.web.admin.AdminMenuRes;

@Configuration
public class MailSenderInit {
    
    public final static String KEY = "mail-manage";
    
    @Bean
    public AdminMenu mailMenu() {
        AdminMenu menu = new AdminMenu();
        menu.setKey(KEY);
        menu.setName("邮件模块");
        menu.setIcon("fas fa-envelope");
        menu.setHref("");
        menu.setSort(6);
        menu.setParentKey(AdminMenuRes.MENU_BASE);
        return menu;
    }

    @Bean
    public AdminMenu mailSendMenu() {
        AdminMenu menu = new AdminMenu();
        menu.setKey("mail-send");
        menu.setName("发送邮件");
        menu.setIcon("fas fa-envelope");
        menu.setHref("/admin/mail/send");
        menu.setSort(1);
        menu.setParentKey(KEY);
        return menu;
    }
    
    @Bean
    public AdminMenu mailTemplateMenu() {
        AdminMenu menu = new AdminMenu();
        menu.setKey("mail-template");
        menu.setName("邮件模板");
        menu.setIcon("fas fa-copy");
        menu.setHref("/admin/mail/template");
        menu.setSort(2);
        menu.setParentKey(KEY);
        return menu;
    }
    
    @Bean
    public AdminMenu mailSenderMenu() {
        AdminMenu menu = new AdminMenu();
        menu.setKey("mail-sender");
        menu.setName("邮件设置");
        menu.setIcon("fas fa-cog");
        menu.setHref("/admin/mail/sender");
        menu.setSort(3);
        menu.setParentKey(KEY);
        return menu;
    }
    
}
